package demo06获取任意一年的二月的天数;

import java.time.Year;
import java.util.Calendar;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个年份：");
        int year = sc.nextInt();
        Calendar c=Calendar.getInstance();
        c.set(year,2,1);
        c.add(Calendar.DAY_OF_MONTH,-1);
        int day = c.get(Calendar.DAY_OF_MONTH);
        System.out.println("day = " + day);
    }
}
